<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>活体检测</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<script type="text/javascript">
    var grid = null;
    var addGSData_s = {};
    var addSONData_s = {};
    $(function () {
        var _url = '<%=path%>/riskctrl/rccstbscinfo/initList.do';
        $("#ligergrid1").ligerGrid({
            url: _url,
            method: 'get',
            columns: [
                {display: '所属机构', name: 'cstMgrOrgCdNm', align: 'left', width: 150},
                {display: '省公司', name: 'prOrgCdNm', align: 'left', width: 150},
                {display: '分公司', name: 'cyOrgCdNm', align: 'left', width: 150},
                {display: '车型', name: 'prdTypCdNm', align: 'left', width: 200},
                {display: '客户名称', name: 'cstNm', align: 'center', width: 100},
                {display: '手机号', name: 'mp1', align: 'left', width: 150},
                {display: '经销商', name: 'splNm', align: 'left', width: 150},
                {display: '业务员', name: 'crtNm', align: 'left', width: 150},
                {display: '客户经理', name: 'cstMgrNm', align: 'left', width: 200},
                {display: '照片', align: 'left', width: 150,
                    render: function (rowdata, rowindex, value){
                        var h;
                        h='<a href="javascript:uploadFileByUrl(';
                        h+="'"+rowdata.filePath+"'";
                        h+=",'"+rowdata.fileNm+"'";
                        h+=')">'+rowdata.fileNm+'</a>'
                        return h;
                    }
                },
                {display: '评分', name: 'livScore', align: 'left', width: 150},
                {display: '状态', name: 'livAudStsCdNm', align: 'left', width: 150},
                {display: '时间', name: 'livTm', align: 'left', width: 150, render: renderDate}
            ],
            pageSize: 10,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            checkbox: false,
            rownumbers: true,
            allowUnSelectRow: true,
            alternatingRow: false,
            onBeforeShowData: function () {
                var grid = this;
                grid.collapsedRows = [];
            }
        });
        grid = liger.get("ligergrid1");
        grid.setHeight(100);
        $("#searchBar").ligerForm();

        $("#searchBtn").click(function (event) {
            var form = new liger.get("searchBar");
            var data = form.getData();
            for (name in data) {
                grid.setParm(name, data[name]);
            }
            grid.reload();
        });
        $("#clearBtn").click(function (event) {
            $("#resetBtn").click();  //重置 input-text
        });
    });
    function uploadFileByUrl(_url,_name){
        if(SQ.regs.img.test(_name)){
            //SQ.imgPreview(_url);
            window.__ImgSrc = _url;
            window.__ImgTit = _name;
            window.open('<%=path%>/project/prjbscinfo/imgWinOpen.do', '', 'location=yes, width=800, height=600');
        }else{
            window.open(_url);
        }
    }
    //格式化时间
    function renderDate(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DDHHMMSS);
        }
        return dateStr;
    }
</script>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
            <div class="fieldset1 clearFix">
                <div class="fieldBox">
                    <div class="label">客户姓名</div>
                    <div class="field">
                        <input name="cstNm" id="cstNm" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">手机号</div>
                    <div class="field">
                        <input name="mp" id="mp" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">经销商</div>
                    <div class="field">
                        <input name="splNm" id="splNm" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">状态</div>
                    <div class="field">
                        <select name="livAudStsCd" id="livAudStsCd" data-value=" ">
                            <option value=" " seleted>请选择</option>
                            <c:forEach items="${audStsCdDicList }" var="kv">
                                <option value="${kv.key }">${kv.value }</option>
                            </c:forEach>
                        </select>
                    </div>
                </div>
                <div class="clearFix"></div>
                <div class="btnsBox formBtns notRight">
                    <span id="searchBtn" class="sq-button-round">查询</span>
                    <span id="clearBtn" class="sq-button-round">清空</span>
                    <%--<span id="addBtn" class="sq-button-round">新增</span>--%>

                    <input id="resetBtn" type="reset" value="重置" class="l-button l-button-reset Hide"/>
                </div>
            </div>
        </form>
    </div>
</div>
<div id="ligergrid1" class="sq-grid"></div>
</body>
</html>